The present invention relates to encoding. In particular, the present invention relates to encoding for restricted channels.
In digital communications, data is transferred from a source to a destination through a channel. All channels are limited by their bandwidth, which represents the amount of data the channels can carry. Some channels are also restricted by the types of data they can carry. For example, many electronic mail channels and many pager channels do not allow data to pass unless it is in the form of a printable character. This limitation requires that each byte of data have a value between "20" hexadecimal (hex) and "7E" hex.
To send larger amounts of data across bandwidth-limited channels, the art has developed several compression algorithms. Typically, these compression algorithms replace sections of data in the data stream with compression codes. The compression codes identify earlier-transmitted sections of data that are identical to the replaced sections of data. Since the compression codes are smaller than the sections of data they replace, the total amount of data passed through the channel is reduced.
In order to decompress the data at the destination, the decompression algorithm must be able to distinguish the compression codes from the data. To assist the decompression algorithms, many compression algorithms embed a "mask" into the data that identifies the location of the compression codes in the compressed data stream.
In the prior art, the output produced by the compression algorithm was strictly binary and did not take into consideration channel restrictions that require the data to be within a certain range. To overcome this limitation, the art has used channel encoders, such as UUENCODE and MIME, which convert the binary values produced by the compression algorithm into an acceptable range of values. For example, in UUENCODE, every three bytes of data from the compression algorithm are divided into four 6-bit segments. Two zeros are then added above the highest bit locations in the four 6-bit segments. This forms four 8-bit segments. A hexadecimal value of "20" is then added to each of the four 8-bit segments, forming four 8-bit segments with values of no less than "20" hexadecimal and no more than "5F" hexadecimal.
Although the prior art provided compressed and encoded data that could travel through a restricted channel, the prior art is extremely inefficient. In particular, UUENCODE expands every three bytes of compressed data into four bytes of compressed data. In addition, such encoding does not take advantage of the fact that many bytes produced by compression algorithms do not need further encoding because they already meet the restrictions of the channel.